00001
00002
00003
00004 #pragma once
00005
00006 #include "stdafx.h"
00007 #include "TraffEdu.h"
00008 #include "TraffEduDoc.h"
00009 #include "FileHandler/FileHandler.h"
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #endif
00013
00014
00015
00016
00017 IMPLEMENT_DYNCREATE(CTraffEduDoc, CDocument)
00018
00019 BEGIN_MESSAGE_MAP(CTraffEduDoc, CDocument)
00020 END_MESSAGE_MAP()
00021
00022
00023
00024
00025
00026 CTraffEduDoc::CTraffEduDoc()
00027 {
00028 ((CTraffEduApp*)AfxGetApp())->m_pDoc = this;
00029
00030 }
00031
00032
00033
00034 CTraffEduDoc::~CTraffEduDoc()
00035 {
00036 }
00037 BOOL CTraffEduDoc::OnOpenDocument(LPCTSTR lpszPathName)
00038 {
00039 m_csFileName = lpszPathName;
00040
00041 if (!CDocument::OnOpenDocument(lpszPathName))
00042 return FALSE;
00043
00044 return TRUE;
00045
00046 }
00047
00048 BOOL CTraffEduDoc::OnNewDocument()
00049 {
00050 if (!CDocument::OnNewDocument())
00051 return FALSE;
00052
00053 return TRUE;
00054 }
00055
00056 FileHandler fileHandler;
00057 void CTraffEduDoc::Serialize(CArchive& ar)
00058 {
00059 if (ar.IsStoring())
00060 {
00061 fileHandler.saveFile(ar);
00062 }
00063 else
00064 {
00065 fileHandler.loadFile(ar);
00066 }
00067 }
00068
00069
00070
00071
00072 #ifdef _DEBUG
00073 void CTraffEduDoc::AssertValid() const
00074 {
00075 CDocument::AssertValid();
00076 }
00077
00078 void CTraffEduDoc::Dump(CDumpContext& dc) const
00079 {
00080 CDocument::Dump(dc);
00081 }
00082 #endif //_DEBUG
00083